<?php
class Identity_model extends CI_Model
{
	function __construct()
	{
		parent::__construct();

	}
	function getIdentity($uid)
	{
		$query =  $this->db->query("select identitycode, realname,createtime from  memberindentity where uid= ".$uid);
		return $query->row();
	}

	function updateIdentity($uid,$identitycode,$realname)
	{
		$sql="insert into memberindentity (uid, identitycode,realname,createtime) values (".$uid.",'".$identitycode."','".$realname."',".time().") ON DUPLICATE KEY UPDATE identitycode= VALUES(identitycode),realname='".$realname."'";
		$this->db->query($sql);
		return TRUE;
	}
	
}
?>